<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:71:"G:\wwwroot\vidio.test\public/../application/index\view\daili\login.html";i:1531322643;}*/ ?>

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
	    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
		<title>login</title>
		<link rel="stylesheet" href="/login/css/bootstrap.min.css" />
		<link rel="stylesheet" href="/login/css/style.css" />
	</head>
	<body>
		<div class="page-sign page-bg">
			<header>
				<img src="/login/img/Logo.png" class="logo" />
			</header>
			<div class="sign-login">
				<div class="row">
					<a href="" class="col-xs-6 a-now a-sign" title="group-sign-in">登录</a>
					<a href="" class="col-xs-6 a-sign" title="group-sign-up">注册</a>
				</div>
				<div class="a-cont">
			
					<ul class="list-group group-sign-in">
						<li class="list-item">
							<label class="user-name">
								<input type="text" placeholder="用户名" name="uname" />
							</label>
						</li>
						<li class="list-item">
							<label class="pass-word">
								<input type="password" placeholder="密码" name="pwd" />
							</label>
						</li>
						<button onclick="go()" style="margin-top:20px" class="btn btn-all" type="submit">走你</button>
					</ul>
							
					<ul class="list-group group-sign-up">
						<li class="list-item">
							<label class="user-name">
								<input type="text" id="regu" placeholder="用户名" />
							</label>
						</li>
						<li class="list-item">
							<label class="pass-word">
								<input type="password" id="regp" placeholder="密码" />
							</label>
						</li>		

						<li class="list-item">
							<label class="bir">
								<input type="text" id="regno" placeholder="邀请码" />
							</label>
						</li>	
				<div class="btn-foot">
					        <button onclick="goreg()" class="btn btn-all" type="submit">注册</button>
					        <a href="">获取邀请码</a>
				        </div>
					</ul>
				
				</div>
			</div>
		</div>
		
		<script type="text/javascript" src="/login/js/jquery-1.11.0.js" ></script>
		<script>
			var goreg = ()=>{
				var y_no  = $("#regno").val();
				$.ajax('/daili.php/reg.html?me=reg&y_no='+y_no,{
					data:{
						'user_name':$("#regu").val(),
						'user_pwd' :$("#regp").val(),
						'user_reg_ip':'<?php echo $_SERVER["REMOTE_ADDR"]; ?>'
					},
					type:'POST',
					success:(data)=>{
						if(data.code){
							alert('注册成功');
							window.location.href="/daili.php";
						}else{
							alert(data.msg);
						}
					}
				})
			}
			$(".page-bg").css("min-height",$(window).height());
			
			$(".a-sign").each(function  () {
				$(this).click(function  (e) {
					e.preventDefault();
					$(".a-now").removeClass("a-now");
					$(this).addClass("a-now");
					var get_t = $(this).attr("title");
					$(".list-group").hide();
					$("."+get_t).show();
			        $(".page-bg").css("min-height",$(window).height());					
				})
			})
			
            var go = () =>{
                $.ajax('/daili.php/login.html',{
                    type:'POST',
                    data:{
                        'user_name':$("[name=uname]").val(),
                        'user_pwd':$("[name= pwd ]").val(),
                    },
                    success:(data)=>{
                        alert(data.msg);
                        if(data.code == 1){
                            window.location.href='/<?= empty($_GET["url"]) ? "/daili.php"  :  $_GET["url"] ?>';
                        }
                        $("[name= pwd ]").val('');
                    }
                })
            }
			
		</script>
	</body>
</html>
